#include "getmd5.h"
QString GetMD5::getFileMd5(const QString &path)
{
    if(path.isEmpty())
        return QString();

    QCryptographicHash md5Hash(QCryptographicHash::Md5);
    QFile file(path);
    if(file.open(QIODevice::ReadWrite))
    {
        while (!file.atEnd())
        {
            QString data = file.read(1024*1024);
            QByteArray curData=data.toLatin1();
            md5Hash.addData(curData,curData.size());
            qApp->processEvents();
            qDebug()<< md5Hash.result().toHex();
        }
    }

    file.close();

    return md5Hash.result();
}
